//
//  RootControl.m
//  HGold
//
//  Created by iMacOne on 16/5/7.
//  Copyright © 2016年 iMacOne. All rights reserved.
//

#import "RootControl.h"
#import "Header.h"
@interface RootControl ()

@end

@implementation RootControl

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.automaticallyAdjustsScrollViewInsets = NO;
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
    self.navigationController.navigationBar.barTintColor = HOME_COLOR;
    self.navigationController.navigationBar.translucent = NO;

    self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    self.navigationController.interactivePopGestureRecognizer.delegate = nil;
    
//    UIImageView * menuImage = [[UIImageView alloc] initWithFrame:CGRectMake(-7, 10, 20, 20)];
//    menuImage.image = [UIImage imageNamed:@"back"];
//    self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
//    _backButton.frame = CGRectMake(0, 0, 50, 40);
//    [_backButton addSubview:menuImage];
//    [_backButton addTarget:self action:@selector(pop) forControlEvents:UIControlEventTouchUpInside];
//    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:_backButton];
}
- (void)pop{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)setupNav{
    
    UIImageView * menuImage = [[UIImageView alloc] initWithFrame:CGRectMake(-7, 10, 20, 20)];
    menuImage.image = [UIImage imageNamed:@"back"];
    self.backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.backButton.frame = CGRectMake(0, 0, 50, 40);
    [self.backButton addSubview:menuImage];
    [self.backButton addTarget:self action:@selector(pop) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.backButton];
}

@end
